package com.study.animationstudy.ui

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import com.study.animationstudy.base.BaseActivity
import com.study.animationstudy.databinding.ActivityDmBinding
import kotlin.random.Random

class DmActivity : BaseActivity<ActivityDmBinding>() {

    val mCommentArray = arrayOf("武夷山", "仙霞岭", "阿里山", "白云山", "九华山",
        "长白山", "峨眉山", "五台山", "太白山", "昆仑山",
        "六盘山", "乌蒙山", "井冈山", "武当山", "普陀山",
        "祁连山", "贺兰山", "太行山", "双鸭山", "五指山")

    override fun ActivityDmBinding.initBinding() {
        mBinding.btnComment.setOnClickListener {
            val comment = mCommentArray[java.util.Random().nextInt(20)]
            // 给弹幕视图添加评论
            mBinding.bvComment.addComment(comment)
        }
    }

}